<?php


namespace App\Services\Core\Curd;


trait DeleteService
{
    public function destroy(bool $id = true)
    {
        if (empty($this->options)) $this->fail(msg: '请设置删除条件');

        if ($id && !isset($this->options['id'])) $this->fail(msg: '请选择一个目标');

        return $this->model->where($this->options)->delete();
    }
}
